<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 *
 * @author Joker
 *        
 * id MEDIUMINT(6) AUTO_INCREMENT,
	`name` VARCHAR(20) NOT NULL COMMENT '组名',
	display_name VARCHAR(100) NOT NULL DEFAULT '' COMMENT '介绍',
 */
class Group extends Model
{
    protected $table = 'group';
    
    protected $fillable = ['id','name','display_name'];
    
    public $timestamps = false;
    
    /**
     * 根据用户组获取 相关角色
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function group_roles()
    {
        return $this->belongsToMany('App\Models\Role');
    }
}